package com.xin.springcloudsms.controller;

import com.aliyuncs.exceptions.ClientException;
import com.xin.springcloudsms.service.KeyUtil;
import com.xin.springcloudsms.service.SmsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class SmsController {
    @GetMapping("/send")
    public void send(@RequestParam(name = "phone")String phone) throws ClientException, InterruptedException {
        SmsUtils.startSend(phone);
        log.info("发送成功,phone:{}",phone);
    }
}
